﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using com.eforceglobal.crux.views.Administration;
using com.eforceglobal.crux.controllers.Administration;
using com.eforceglobal.crux.DTOs.Configuration;

public partial class Administration_ResetPassword : BaseView, IResetPassword
{
    ResetPasswordController _controller = null;

    protected void Page_Load(object sender, EventArgs e)
    {
        _controller = new ResetPasswordController(this);
        _controller.InitView(IsPostBack);
    }

    #region IResetPassword Members

    public int UserID
    {
        get { return int.Parse(Request.Params["id"].ToString()); }
    }

    public string NewPassword
    {
        get
        {
            return txtNewPassword.Text;
        }
        set
        {
            txtNewPassword.Text = value;
        }
    }

    public string ConfirmedNewPassword
    {
        get
        {
            return txtConfirmedNewPassword.Text;
        }
        set
        {
            txtConfirmedNewPassword.Text = value;
        }
    }

    public ErrorInformation ErrorDetails
    {
        get
        {
            return pnlError.ErrorInformation;
        }
        set
        {
            pnlError.ErrorInformation = value;
        }
    }

    #endregion
    protected void btnSave_Click(object sender, EventArgs e)
    {
        _controller.ResetPassword();
    }
    protected void btnCancel_Click(object sender, EventArgs e)
    {
        _controller.RedirectToRelevantView();
    }
}
